home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
AIncludes
/
Timing.a
< prev
next >
Wrap
Text File
|
1996-05-01
|
5KB
|
201 lines
;
; File: Timing.a
;
; Contains: Kernel Timing Interfaces.
;
; Version: Technology: System 8
; Release: Universal Interfaces 3.0d3 on Copland DR1
;
; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
;
; Bugs?: If you find a problem with this file, send the file and version
; information (from above) and the problem description to:
;
; Internet: apple.bugs@applelink.apple.com
; AppleLink: APPLE.BUGS
;
;
IF &TYPE('__TIMING__') = 'UNDEFINED' THEN
__TIMING__ SET 1
IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
include 'Types.a'
ENDIF
IF FOR_SYSTEM8_PREEMPTIVE THEN
kDurationMicrosecond EQU -1 ; Microseconds are negative
kDurationMillisecond EQU 1 ; Milliseconds are positive
kDurationSecond EQU 1000 ; 1000 * durationMillisecond
kDurationMinute EQU 60000 ; 60 * durationSecond,
kDurationHour EQU 3600000 ; 60 * durationMinute,
kDurationDay EQU 86400000 ; 24 * durationHour,
kDurationNoWait EQU 0 ; don't block
kDurationForever EQU $7FFFFFFF ; no time limit
IF OLDROUTINENAMES THEN
durationMicrosecond EQU -1
durationMillisecond EQU 1
durationSecond EQU 1000
durationMinute EQU 60000
durationHour EQU 3600000
durationDay EQU 86400000
durationNoWait EQU 0
durationForever EQU $7FFFFFFF
ENDIF
Nanoseconds RECORD 0
f ds UInt64
sizeof EQU * ; size: $8 (8)
ENDR
; typedef UInt32 Ticks
;
; Time Information Routines
;
;
; extern AbsoluteTime UpTime(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION UpTime
ENDIF
;
; extern AbsoluteTime TaskCPUTime(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION TaskCPUTime
ENDIF
;
; extern void GetTimeBaseInfo(UInt32 *theMinAbsoluteTimeDelta, UInt32 *theAbsoluteTimeToNanosecondNumerator, UInt32 *theAbsoluteTimeToNanosecondDenominator, UInt32 *theProcessorToAbsoluteTimeNumerator, UInt32 *theProcessorToAbsoluteTimeDenominator)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetTimeBaseInfo
ENDIF
;
; Timing Conversion Routines
;
;
; extern Nanoseconds AbsoluteToNanoseconds(AbsoluteTime theAbsoluteTime)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AbsoluteToNanoseconds
ENDIF
;
; extern Duration AbsoluteToDuration(AbsoluteTime theAbsoluteTime)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AbsoluteToDuration
ENDIF
;
; extern AbsoluteTime NanosecondsToAbsolute(Nanoseconds theNanoseconds)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION NanosecondsToAbsolute
ENDIF
;
; extern AbsoluteTime DurationToAbsolute(Duration theDuration)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DurationToAbsolute
ENDIF
;
; extern Nanoseconds DurationToNanoseconds(Duration theDuration)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DurationToNanoseconds
ENDIF
;
; extern Duration NanosecondsToDuration(Nanoseconds theNanoseconds)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION NanosecondsToDuration
ENDIF
;
; extern Ticks AbsoluteToTicks(AbsoluteTime theAbsoluteTime)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AbsoluteToTicks
ENDIF
;
; extern AbsoluteTime TicksToAbsolute(Ticks theTicks)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION TicksToAbsolute
ENDIF
;
; AbsoluteTime Adjustment Routines
;
;
; extern AbsoluteTime AddAbsoluteToAbsolute(AbsoluteTime theAbsoluteTime1, AbsoluteTime theAbsoluteTime2)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AddAbsoluteToAbsolute
ENDIF
;
; extern AbsoluteTime SubAbsoluteFromAbsolute(AbsoluteTime theLeftAbsoluteTime, AbsoluteTime theRightAbsoluteTime)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SubAbsoluteFromAbsolute
ENDIF
;
; extern AbsoluteTime AddNanosecondsToAbsolute(Nanoseconds theNanoseconds, AbsoluteTime theAbsoluteTime)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AddNanosecondsToAbsolute
ENDIF
;
; extern AbsoluteTime AddDurationToAbsolute(Duration theDuration, AbsoluteTime theAbsoluteTime)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AddDurationToAbsolute
ENDIF
;
; extern AbsoluteTime SubNanosecondsFromAbsolute(Nanoseconds theNanoseconds, AbsoluteTime theAbsoluteTime)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SubNanosecondsFromAbsolute
ENDIF
;
; extern AbsoluteTime SubDurationFromAbsolute(Duration theDuration, AbsoluteTime theAbsoluteTime)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SubDurationFromAbsolute
ENDIF
;
; Timing Delta Routines
;
;
; extern Nanoseconds AbsoluteDeltaToNanoseconds(AbsoluteTime theLeftAbsoluteTime, AbsoluteTime theRightAbsoluteTime)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AbsoluteDeltaToNanoseconds
ENDIF
;
; extern Duration AbsoluteDeltaToDuration(AbsoluteTime theLeftAbsoluteTime, AbsoluteTime theRightAbsoluteTime)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AbsoluteDeltaToDuration
ENDIF
ENDIF
ENDIF ; __TIMING__